package com.heima.reggie.config;

import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MyBatisPlusConfig {

    @Bean
    public MybatisPlusInterceptor mpi (){

        //1. 构建mybatis拦截器集合
        MybatisPlusInterceptor mpi = new MybatisPlusInterceptor();

        //2. 添加进去分页拦截器
        mpi.addInnerInterceptor(new PaginationInnerInterceptor());

        return mpi;
    }

}
